🧱 Docker configuration

Signed-off-by: Pau Costa <mico@micodev.es>
CR
Pau Costa Ferrer 2024-02-01 17:58:22 +01:00
parent 6e1164f34a
commit fcced63c34
3 changed files with 60 additions and 0 deletions

17
client/Dockerfile Normal file
View File

@ -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"]

28
docker-compose.yml Normal file
View File

@ -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

15
server/Dockerfile Normal file
View File

@ -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"]