Skip to content

Commit

Permalink
Merge pull request #2 from NextGenOP/main
Browse files Browse the repository at this point in the history
Create .dockerignore
  • Loading branch information
hutamatr authored Feb 18, 2023
2 parents 7981ab5 + bce28cd commit 75df951
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.git
node_modules
build
*.lock
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ FROM node:18.14.0-alpine
RUN mkdir app
WORKDIR /app

ARG REACT_APP_NODE_ENV
ARG REACT_APP_BASE_URL

ENV REACT_APP_NODE_ENV="production"
ENV REACT_APP_BASE_URL="http://localhost:8002/api/v1"

COPY . .
RUN yarn
RUN yarn build
Expand All @@ -11,5 +17,3 @@ CMD serve -s build
EXPOSE 3000/tcp


ENV REACT_APP_NODE_ENV="production"
ENV REACT_APP_BASE_URL="http://localhost:8002/api/v1"
10 changes: 9 additions & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@ services:
ports:
- '5432:5432'
environment:
- 'POSTGRES_USER=postgres'
- 'POSTGRES_DB=todo-list'
- 'POSTGRES_PASSWORD=root'
volumes:
- postgresdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]

app-backend:
container_name: app-backend
build:
Expand All @@ -17,7 +24,8 @@ services:
image: 'backend-todolist:1.0.0'
restart: always
depends_on:
- postgresql-backend
postgresql-backend:
condition: service_healthy
ports:
- '8002:8002'
environment:
Expand Down

0 comments on commit 75df951

Please sign in to comment.