Update Dockerfile
Browse files- Dockerfile +12 -6
Dockerfile
CHANGED
|
@@ -36,20 +36,26 @@ COPY --chown=pn frontend frontend
|
|
| 36 |
WORKDIR $HOME/app/frontend
|
| 37 |
RUN npm install
|
| 38 |
RUN npm run build
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
USER pn
|
| 44 |
WORKDIR $HOME/app
|
| 45 |
|
| 46 |
COPY --chown=pn backend backend
|
| 47 |
-
|
| 48 |
COPY --chown=pn default.conf /etc/nginx/conf.d/default.conf
|
| 49 |
|
| 50 |
# Prepare the entrypoint script
|
| 51 |
COPY --chown=pn run.sh run.sh
|
| 52 |
-
|
| 53 |
RUN chmod +x run.sh
|
| 54 |
|
| 55 |
# Expose the port 8080
|
|
|
|
| 36 |
WORKDIR $HOME/app/frontend
|
| 37 |
RUN npm install
|
| 38 |
RUN npm run build
|
| 39 |
+
|
| 40 |
+
# Debugging: Check if dist directory exists after build
|
| 41 |
+
RUN ls -la
|
| 42 |
+
RUN if [ ! -d "dist" ]; then echo "Build did not create dist directory, exiting..."; exit 1; fi
|
| 43 |
+
|
| 44 |
+
# Switch to the directory where nginx expects static files
|
| 45 |
+
WORKDIR /usr/share/nginx/html
|
| 46 |
+
|
| 47 |
+
# Copy the build output to the nginx serving directory
|
| 48 |
+
COPY --chown=pn $HOME/app/frontend/dist .
|
| 49 |
+
|
| 50 |
+
# Switch back to the app directory and setup the backend
|
| 51 |
USER pn
|
| 52 |
WORKDIR $HOME/app
|
| 53 |
|
| 54 |
COPY --chown=pn backend backend
|
|
|
|
| 55 |
COPY --chown=pn default.conf /etc/nginx/conf.d/default.conf
|
| 56 |
|
| 57 |
# Prepare the entrypoint script
|
| 58 |
COPY --chown=pn run.sh run.sh
|
|
|
|
| 59 |
RUN chmod +x run.sh
|
| 60 |
|
| 61 |
# Expose the port 8080
|