oliverdavies.uk/Dockerfile

60 lines
898 B
Docker
Raw Normal View History

2021-07-03 22:00:45 +00:00
FROM opdavies/sculpin-serve AS app
2021-07-24 19:38:35 +00:00
#
2021-07-24 19:38:35 +00:00
FROM app AS build
ENV PATH=$PATH:/app/vendor/bin/phpunit
2021-07-03 22:00:45 +00:00
WORKDIR /app
2021-07-03 22:00:45 +00:00
COPY composer.* ./
2021-07-24 19:38:35 +00:00
RUN composer install --no-dev
2021-07-03 22:00:45 +00:00
COPY app app
COPY source source
2021-08-25 00:30:52 +00:00
COPY src src
2021-07-24 19:38:35 +00:00
RUN sculpin generate --env prod
2021-07-03 22:00:45 +00:00
#
2021-11-11 08:09:51 +00:00
FROM node:14-alpine AS assets
RUN apk add --no-cache make
2021-07-24 19:38:35 +00:00
WORKDIR /app
COPY package*.json ./
2021-07-03 22:00:45 +00:00
RUN npm ci
2021-07-03 22:00:45 +00:00
COPY . .
2021-07-03 22:00:45 +00:00
RUN npm run production
#
2021-07-24 19:38:35 +00:00
FROM nginx:1 AS production
2021-07-24 19:38:35 +00:00
COPY tools/docker/images/nginx/root/ /
2021-08-16 12:00:00 +00:00
RUN mkdir -p /code && \
chown -R nginx:nginx /code && \
chmod -R 755 /code && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d
2021-08-16 12:00:00 +00:00
RUN touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
2021-08-16 12:00:00 +00:00
USER nginx
2021-08-16 12:00:00 +00:00
WORKDIR /code
2021-08-16 12:00:00 +00:00
COPY --chown=nginx --from=build /app/output_prod ./
COPY --chown=nginx --from=assets /app/source/build build
2021-08-16 12:00:00 +00:00
EXPOSE 8080