Skip to content

Commit

Permalink
Added frontend to docker
Browse files Browse the repository at this point in the history
  • Loading branch information
vilnor committed May 1, 2024
1 parent 01ec799 commit a57ec99
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 12 deletions.
29 changes: 17 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ services:
- 8081:8080
depends_on:
- db

# frontend:
# build:
# dockerfile: Dockerfile
# context: ./frontend
# environment:
# PORT: 3000
# BACKEND_PORT: 8080
# ports:
# - 3000:3000
# depends_on:
# - backend


frontend:
build:
dockerfile: Dockerfile
context: ./frontend
restart: always
volumes:
- ./frontend/src:/app/src
- /app/node_modules
- /app/.next
environment:
NEXT_PUBLIC_API_URL: "http://localhost:8080"
ports:
- 3000:3000
depends_on:
- backend
20 changes: 20 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM node:latest

WORKDIR /app

COPY ./package.json /app
COPY ./package-lock.json /app
RUN npm ci

COPY ./next.config.mjs .
COPY ./postcss.config.js .
COPY ./postcss.config.mjs .
COPY ./tailwind.config.ts .
COPY ./tsconfig.json .
COPY ./typography.ts .
COPY ./src ./src
COPY ./public ./public

ENV NEXT_PUBLIC_API_URL=http://localhost:8080

CMD ["npm", "run", "dev"]

0 comments on commit a57ec99

Please sign in to comment.