Skip to content

Commit 45381c2

Browse files
authored
Merge pull request #525 from DDMAL/font-fix
fix: update nginx build context and add production Dockerfile
2 parents 6cd05fa + a9683be commit 45381c2

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

docker-compose-deployment.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@ services:
4444
restart: unless-stopped
4545

4646
nginx:
47-
build: ./nginx
47+
build:
48+
context: .
49+
dockerfile: ./nginx/Dockerfile.prod
4850
container_name: vim-nginx
4951
restart: unless-stopped
5052
environment:
5153
- HOST_NAME=${HOST_NAME}
5254
ports:
5355
- "8000:80"
5456
volumes:
55-
- ./web-app/frontend/assets/:/virtual-instrument-museum/frontend/assets/
5657
- vim-static:/virtual-instrument-museum/static
5758
- vim-media:/virtual-instrument-museum/media
5859
depends_on:

nginx/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
FROM nginx:1.25.2
22
COPY ./nginx.conf /etc/nginx/nginx.conf
3-
COPY ./vim.conf.template /etc/nginx/templates/vim.conf.template
3+
COPY ./vim.conf.template /etc/nginx/templates/vim.conf.template

nginx/Dockerfile.prod

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Production nginx: includes compiled frontend assets in the image
2+
# (Dev uses bind mounts instead, see docker-compose.yml)
3+
4+
FROM node:20-slim AS frontend-builder
5+
COPY ./web-app/frontend/ /frontend/
6+
WORKDIR /frontend
7+
RUN npm install && npm run sass:build
8+
9+
FROM nginx:1.25.2
10+
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
11+
COPY ./nginx/vim.conf.template /etc/nginx/templates/vim.conf.template
12+
# Copy static assets (images, fonts, etc.) and compiled CSS
13+
COPY ./web-app/frontend/assets/ /virtual-instrument-museum/frontend/assets/
14+
COPY --from=frontend-builder /frontend/assets/css /virtual-instrument-museum/frontend/assets/css

0 commit comments

Comments
 (0)