Skip to content
Snippets Groups Projects
Commit 5d583017 authored by Tomáš Valenta's avatar Tomáš Valenta
Browse files

improve + fix dockerfile

parent cba9a5dc
Branches
No related tags found
No related merge requests found
Pipeline #13542 failed
FROM python:3.10
FROM python:3.10 as base
RUN mkdir /app
WORKDIR /app
# Setup env
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONFAULTHANDLER 1
ENV DEBIAN_FRONTEND noninteractive
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | bash -
RUN apt-get install nodejs && rm -rf /var/lib/apt/lists/*
COPY . .
FROM base AS python-deps
# Install pipenv and compilation dependencies
RUN pip install -U virtualenv pipenv
......@@ -19,9 +20,20 @@ COPY Pipfile.lock .
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install --deploy
RUN PIPENV_VENV_IN_PROJECT=1 pipenv install gunicorn
FROM base AS runtime
# Copy virtual env from python-deps stage
COPY --from=python-deps /.venv /.venv
ENV PATH="/.venv/bin:$PATH"
# Create app workdir
RUN mkdir /app
WORKDIR /app
COPY . .
RUN bash -c "adduser --disabled-login --quiet --gecos app app && \
chmod -R o+r /app/ && \
chmod o+x /app/run.sh"
USER app
# Expose main port
EXPOSE 8080
1.6.6
1.6.7
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment