Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added frontend to docker #25

Merged
merged 1 commit into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Loading