45 lines
1.5 KiB
Docker
45 lines
1.5 KiB
Docker
FROM python:3.6
|
|
MAINTAINER Dorian Pula <dorian.pula@amber-penguin-software.ca>
|
|
|
|
# Add Docker utilities
|
|
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb \
|
|
&& dpkg -i dumb-init_*.deb
|
|
|
|
ENV DOCKERIZE_VERSION v0.3.0
|
|
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
|
|
|
# Install Node and Yarn
|
|
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - \
|
|
&& apt-get install -y nodejs \
|
|
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
|
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
|
|
&& apt-get update \
|
|
&& apt-get install -y yarn
|
|
|
|
# Install Python dependencies
|
|
COPY requirements.txt /app/rookeries/
|
|
RUN pip install --requirement /app/rookeries/requirements.txt
|
|
|
|
# Install Node dependencies
|
|
COPY package.json /app/rookeries/
|
|
COPY yarn.lock /app/rookeries/
|
|
RUN cd /app/rookeries && yarn install
|
|
|
|
# Copy in Rookeries server code
|
|
COPY . /app/rookeries/
|
|
RUN mkdir -p /app/rookeries/dist/ \
|
|
&& mkdir -p /app/rookeries/static/js/
|
|
WORKDIR /app/rookeries/
|
|
|
|
# Fix permissions
|
|
RUN chown www-data . --recursive \
|
|
&& chgrp www-data . --recursive \
|
|
&& chmod g+rw . --recursive
|
|
|
|
USER www-data
|
|
ENTRYPOINT ["/usr/bin/dumb-init", "--"]
|
|
CMD ["inv", "server.run"]
|
|
EXPOSE 5000
|