docker thing

This commit is contained in:
2020-11-13 20:52:24 +03:00
parent 10c16f78ff
commit aaebe63e6d
13 changed files with 155 additions and 19 deletions

View File

@@ -2,14 +2,16 @@
ARG VARIANT="14-buster"
FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:0-${VARIANT}
ENV DOCKERDEV=true
# Update args in docker-compose.yaml to set the UID/GID of the "node" user.
ARG USER_UID=1000
ARG USER_GID=$USER_UID
RUN if [ "$USER_GID" != "1000" ] || [ "$USER_UID" != "1000" ]; then \
groupmod --gid $USER_GID node \
&& usermod --uid $USER_UID --gid $USER_GID node \
&& chmod -R $USER_UID:$USER_GID /home/node \
&& chmod -R $USER_UID:root /usr/local/share/nvm /usr/local/share/npm-global; \
groupmod --gid $USER_GID node \
&& usermod --uid $USER_UID --gid $USER_GID node \
&& chmod -R $USER_UID:$USER_GID /home/node \
&& chmod -R $USER_UID:root /usr/local/share/nvm /usr/local/share/npm-global; \
fi
RUN sudo -u node npm config set unsafe-perm=true

View File

@@ -39,12 +39,16 @@
"dbaeumer.vscode-eslint",
"mtxr.sqltools",
"mtxr.sqltools-driver-mysql",
"ms-vscode.vscode-typescript-tslint-plugin"
"visualstudioexptteam.vscodeintellicode",
"rvest.vs-code-prettier-eslint",
],
// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [1234, 3000],
"forwardPorts": [
1234,
3000
],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "npm config set unsafe-perm=true && npm i && cd frontend && npm i",
// Uncomment to connect as a non-root user. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "node"
"remoteUser": "node"
}

View File

@@ -22,7 +22,7 @@ services:
network_mode: service:db
# Uncomment the next line to use a non-root user for all processes.
# user: node
user: node
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
@@ -31,7 +31,7 @@ services:
image: mariadb:latest
restart: unless-stopped
volumes:
- mariadb-data:/var/lib/mysql
- writermariadb-data:/var/lib/mysql
environment:
MYSQL_DATABASE: writer
MYSQL_USER: writer
@@ -42,7 +42,7 @@ services:
image: mariadb:latest
restart: unless-stopped
volumes:
- mariadbtest-data:/var/lib/mysql
- writermariadbtest-data:/var/lib/mysql
environment:
MYSQL_DATABASE: writer_test
MYSQL_USER: writer
@@ -53,5 +53,5 @@ services:
# (Adding the "ports" property to this file will not forward from a Codespace.)
volumes:
mariadb-data:
mariadbtest-data:
writermariadb-data:
writermariadbtest-data: