Skip to content

Commit

Permalink
added nginx config, changed ports to match
Browse files Browse the repository at this point in the history
  • Loading branch information
ZimLim committed Mar 4, 2024
1 parent 17beeaa commit dbfca67
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deploy/docker-compose-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ services:
restart: always
image: hicsail/comets:staging
ports:
- 5174:4173
- 5174:80
21 changes: 13 additions & 8 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
# ./frontend/Dockerfile
FROM node:20
FROM node:20 as build

WORKDIR /usr/src/app
WORKDIR /app

COPY ./package*.json ./
RUN npm install
COPY . .

ARG VITE_BACKEND_URL

COPY . .
ENV VITE_BACKEND_URL=${VITE_BACKEND_URL}

RUN npm install
RUN npm run build

FROM nginx
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 4173
CMD [ "npm", "run", "preview", "--host"]
CMD nginx -g 'daemon off;'
9 changes: 9 additions & 0 deletions frontend/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
server {
listen 80;

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}

0 comments on commit dbfca67

Please sign in to comment.