forked from scylladb/argus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (36 loc) · 1.2 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ARG PYTHON_VERSION=3.10.4-bullseye
FROM python:${PYTHON_VERSION}
ENV WEBPACK_ENVIRONMENT=production
ENV FLASK_ENV=production
ENV CQLENG_ALLOW_SCHEMA_MANAGEMENT=1
ENV ARGUS_USER=argus
# Create daemon user
RUN useradd -s /bin/bash -c "Argus User" -m ${ARGUS_USER}
ENV PATH="$PATH:/home/${ARGUS_USER}/.local/bin"
# Upgrade everything
RUN apt-get update -y \
&& apt-get upgrade -y
# Install npm and python build dependencies
RUN apt-get install -y build-essential apt-utils
# Install nginx
RUN apt-get install -y nginx-full && \
chown ${ARGUS_USER}:${ARGUS_USER} -R /var/log/nginx /var/lib/nginx
# Install Node.js
RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& npm i -g yarn
# Install Poetry
USER ${ARGUS_USER}
RUN curl -fsSL https://install.python-poetry.org | python3 - --preview
# Copy project files
COPY --chown=${ARGUS_USER}:${ARGUS_USER} . /app
WORKDIR /app
# Build project
RUN poetry install --with default,web-backend,docker-image \
--without dev \
&& yarn \
&& WEBPACK_ENVIRONMENT=${WEBPACK_ENVIRONMENT} yarn webpack \
&& mkdir /app/nginx
VOLUME [ "/app/storage", "/app/config" ]
EXPOSE 8000/tcp
ENTRYPOINT [ "./docker-entrypoint.sh" ]