Skip to content

Commit

Permalink
Merge pull request #43 from xyvora/frontend-docker
Browse files Browse the repository at this point in the history
Add frontend dockerfile
  • Loading branch information
sanders41 authored Dec 28, 2024
2 parents 8413fc7 + 91664d9 commit 0243067
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 4 deletions.
3 changes: 3 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ htmlcov
.venv
.env
*.log
Dockerfile
.dockerignore
.git
2 changes: 1 addition & 1 deletion docker-compose.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
image: backend:dev
build:
context: ./backend
container_name: backend
container_name: scanue-v-backend
depends_on:
- db
- valkey
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.override.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ services:
- default
build:
context: ./backend
container_name: backend
container_name: scanue-v-backend
depends_on:
- db
- valkey
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
- default
build:
context: ./backend
container_name: backend
container_name: scanue-v-backend
depends_on:
- db
- valkey
Expand Down
10 changes: 10 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.gitignore
.next
Dockerfile
.dockerignore
node_modules
.env
.git
logs
*.log
npm-debug.log*
28 changes: 28 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM node:22-alpine AS base

WORKDIR /app

COPY package.json package-lock.json ./

RUN npm ci --production

COPY . .

RUN npm run build

FROM node:22-alpine as prod

WORKDIR /app

# Disable Next.js telemetry
ENV NEXT_TELEMETRY_DISABLED 1

COPY --from=base /app .

RUN useradd --create-home appuser

USER nextjs

EXPOSE 3000

CMD ["npm", "start"]
6 changes: 5 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,8 @@

@docker-build-backend:
cd backend && \
docker build -t scanue-v .
docker build -t scanue-v-backend .

@docker-build-frontend:
cd frontend && \
docker build -t frontend-frontend .

0 comments on commit 0243067

Please sign in to comment.