Commit
This commit is contained in:
@@ -13,15 +13,17 @@ COPY backend/package*.json ./
|
|||||||
RUN npm install
|
RUN npm install
|
||||||
COPY backend/ .
|
COPY backend/ .
|
||||||
|
|
||||||
# Production image using nginx:alpine
|
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
RUN apk add --no-cache nodejs npm
|
||||||
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
COPY docker/nginx.conf /etc/nginx/nginx.conf
|
||||||
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html
|
COPY --from=frontend-build /app/frontend/dist /usr/share/nginx/html
|
||||||
COPY --from=backend-build /backend /backend
|
COPY --from=backend-build /backend /backend
|
||||||
COPY --from=backend-build /backend/entrypoint.sh /backend/entrypoint.sh
|
COPY --from=backend-build /backend/entrypoint.sh /backend/entrypoint.sh
|
||||||
|
|
||||||
# Make entrypoint.sh executable
|
|
||||||
RUN chmod +x /backend/entrypoint.sh
|
RUN chmod +x /backend/entrypoint.sh
|
||||||
|
|
||||||
# Use entrypoint script to start backend and frontend servers
|
|
||||||
ENTRYPOINT ["/backend/entrypoint.sh"]
|
ENTRYPOINT ["/backend/entrypoint.sh"]
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
EXPOSE 3001
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
server {
|
http {
|
||||||
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
|
|
||||||
# Serve the React app
|
# Serve the React app
|
||||||
@@ -28,4 +28,5 @@ server {
|
|||||||
location = /50x.html {
|
location = /50x.html {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user