diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..96a630e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,7 @@ +node_modules +dist +test +.dockerignore +Dockerfile +README.md +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4c7934e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM node:21-alpine + +WORKDIR /app + +COPY package.json ./ + +COPY yarn.lock ./ + +RUN yarn install + +COPY . . + +RUN yarn build + +EXPOSE 3000 + +CMD [ "yarn", "start:prod" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 720b31f..c68a96b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,16 +1,21 @@ -version: '3.8' - -services: - db: - image: postgres:13 - environment: +version: '3.8' + +services: + db: + image: postgres:13 + environment: POSTGRES_USER: ${DB_USERNAME} POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_DB: ${DB_NAME} - ports: - - "5432:5432" - volumes: - - db-data:/var/lib/postgresql/data - -volumes: - db-data: + ports: + - '5432:5432' + volumes: + - db-data:/var/lib/postgresql/data + networks: + - stockdog + +volumes: + db-data: + +networks: + stockdog: