diff --git a/client/Dockerfile b/client/Dockerfile new file mode 100644 index 0000000..2d9c063 --- /dev/null +++ b/client/Dockerfile @@ -0,0 +1,17 @@ +FROM node:18 +LABEL authors="Pau Costa" + +WORKDIR /usr/local/app + +COPY package.json ./ +RUN npm install + +COPY tsconfig.json ./ +COPY src ./src +COPY public ./public + +EXPOSE 3000 + +CMD ["npm", "run", "start"] + + diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5340e57 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ +version: '3.7' +services: + client: + container_name: node_app_client + restart: unless-stopped + build: ./client + ports: + - "8080:3000" + server: + container_name: node_app_server + restart: unless-stopped + build: ./server + ports: + - "3000:3000" + environment: + MYSQL_DATABASE: node_app + MYSQL_USER: node_app + MYSQL_PASSWORD: TestPasswordPleaseChange + depends_on: + - db + db: + image: mysql:5.7 + restart: unless-stopped + environment: + MYSQL_RANDOM_ROOT_PASSWORD: '1' + MYSQL_DATABASE: node_app + MYSQL_USER: node_app + MYSQL_PASSWORD: TestPasswordPleaseChange \ No newline at end of file diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000..44c674f --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,15 @@ +FROM node:18 +LABEL authors="Pau Costa" + +WORKDIR /usr/local/app + +COPY package.json ./ +RUN npm install + +COPY tsconfig.json ./ +COPY src ./src + +EXPOSE 3000 + +CMD ["npm", "run", "start"] +