Feature: dockerized the project

This commit is contained in:
Thom Werring 2024-03-23 20:48:10 +01:00
parent 2a2cac62d5
commit 7aa13eeb51
3 changed files with 33 additions and 0 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
tech-assignment-data
node_modules

14
Dockerfile Normal file
View File

@ -0,0 +1,14 @@
FROM node:20-bookworm-slim
LABEL authors="werring"
WORKDIR /usr/src/app
COPY package*.json .
RUN npm ci
COPY . .
EXPOSE 3000
CMD ["npm", "run", "start:prod"]

17
docker-compose.yml Normal file
View File

@ -0,0 +1,17 @@
services:
api:
build: .
ports:
- "3001:3000"
command: "npm run start:dev"
database:
image: "mysql:8"
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: myfreight
ports:
- 13306:3306
volumes:
- "./database/lib:/var/lib/mysql"
- "./database/entrypoint:/docker-entrypoint-initdb.d"