Skip to content

Commit

Permalink
feat: ✨ setup docker compose for dev and production env
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonfrank committed Jul 4, 2024
1 parent f4f2f12 commit e89c1fb
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 3 deletions.
15 changes: 15 additions & 0 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:20

WORKDIR /app

COPY package*.json ./

RUN npm install -g pnpm

RUN pnpm install

COPY . .

RUN pnpm run build

CMD [ "pnpm", "run", "start:dev" ]
16 changes: 16 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.5'

services:
app:
build:
context: .
dockerfile: Dockerfile.dev
container_name: shopkeeper-api
environment:
ENV: development
ports:
- '3000:3000'
depends_on:
- db
volumes:
- ./src:/app/src
14 changes: 14 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.5'

services:
app:
image: nelsonfrank/shopkeeper-api:main
container_name: shopkeeper-api
environment:
ENV: production
ports:
- '3000:3000'
depends_on:
- db
volumes:
- ./src:/app/src
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ services:
- '5455:5432'

app:
build:
context: .
dockerfile: Dockerfile
image: nelsonfrank/shopkeeper-api:main
container_name: shopkeeper-api
environment:
- PORT=${PORT}
Expand Down

0 comments on commit e89c1fb

Please sign in to comment.