Skip to content

Commit

Permalink
build: docker
Browse files Browse the repository at this point in the history
  • Loading branch information
peam1146 committed Aug 16, 2023
1 parent eebd7cb commit 1998115
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
FROM --platform=amd64 node:18-alpine as base

RUN apk add --no-cache libc6-compat
WORKDIR /app

COPY package.json yarn.lock ./

RUN yarn
RUN yarn install --immutable

COPY ./prisma ./prisma

RUN yarn run prisma generate

COPY . .

RUN yarn run build
RUN yarn run build --webpack

FROM --platform=amd64 node:18-alpine

Expand All @@ -21,4 +21,4 @@ COPY --from=base /app/dist ./dist

EXPOSE 3000

CMD ["node", "dist/src/main"]
CMD ["node", "dist/main"]
14 changes: 10 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
version: '3.8'
services:
backend:
build:
dockerfile: Dockerfile
context: .
env_file:
- .env
db:
container_name: pg_container
image: postgres:15.3-alpine3.18
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test_db
- POSTGRES_USER=root
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=awesomestack
ports:
- '5430:5432'
- '5432:5432'
volumes:
- pg-data:/var/lib/postgresql/data

Expand Down

0 comments on commit 1998115

Please sign in to comment.