Serves public files by a docker container. This separation is done enable easier setup of virtual hosts and https certificates
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
721 B

FROM ubuntu:latest
# update to the latest packages
ENV DEBIAN_FRONTEND="noninteractive"
RUN apt-get update && apt-get upgrade -y
# add user that will be used to install and run the application
RUN groupadd -g 1000 deploy
RUN useradd -m -u 1000 -g deploy deploy
# install required packages for debugging
# RUN apt-get install -y vim curl lsof
#
# CUSTOM PART IS BELOW HERE
#
# install required packages
RUN apt-get install -y nginx
# copy and set up nginx configs
RUN sed -i.bak 's/user www-data;/user deploy;/' /etc/nginx/nginx.conf
RUN rm /etc/nginx/sites-enabled/*
ADD public_nginx_conf /etc/nginx/sites-enabled/public_nginx_conf
# switch to the created user and run nginx
CMD ["nginx", "-g", "daemon off;"]