Consolidate PHP and Nginx Dockerfiles
- Merge separate PHP and Nginx Dockerfiles into a unified structure under `app/docker/Dockerfile`. - Simplify build stages and streamline multi-service configuration for production, development, and utility containers. - Remove outdated individual Dockerfiles (`php/Dockerfile` and `web/Dockerfile`).
This commit is contained in:
@@ -1,31 +0,0 @@
|
||||
FROM docker.io/nginx:1.31-alpine AS build
|
||||
|
||||
COPY docker/web/conf/default.conf.template /etc/nginx/templates/default.conf.template
|
||||
COPY docker/web/conf/fastcgi_params /etc/nginx/fastcgi_params
|
||||
COPY docker/web/start.sh /usr/local/bin/start
|
||||
|
||||
RUN chmod 755 /usr/local/bin/start
|
||||
|
||||
FROM build AS app_build_for_production
|
||||
|
||||
WORKDIR /home/app
|
||||
COPY application /home/app
|
||||
|
||||
RUN apk --no-cache add git nodejs npm \
|
||||
&& npm install && npm run build \
|
||||
&& rm -rf /home/app/node_modules
|
||||
|
||||
FROM build AS production
|
||||
|
||||
COPY --from=app_build_for_production /home/app/public /usr/share/nginx/html
|
||||
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["/usr/local/bin/start"]
|
||||
|
||||
FROM build AS develop
|
||||
WORKDIR /usr/share/nginx/html
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["/usr/local/bin/start"]
|
||||
Reference in New Issue
Block a user