forked from ietf-tools/datatracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.Dockerfile
More file actions
36 lines (28 loc) · 1.46 KB
/
dev.Dockerfile
File metadata and controls
36 lines (28 loc) · 1.46 KB
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
FROM ghcr.io/ietf-tools/datatracker-app-base:latest
LABEL maintainer="IETF Tools Team <tools-discuss@ietf.org>"
ENV DEBIAN_FRONTEND=noninteractive
# Install PostgreSQL Client tools
RUN /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y && \
apt-get update --fix-missing && apt-get install -qy --no-install-recommends postgresql-client-17
# Setup nginx
COPY docker/configs/nginx-proxy.conf /etc/nginx/sites-available/default
COPY docker/configs/nginx-502.html /var/www/html/502.html
# Copy the startup file
COPY docker/scripts/app-init.sh /docker-init.sh
COPY docker/scripts/app-start.sh /docker-start.sh
RUN sed -i 's/\r$//' /docker-init.sh && chmod +rx /docker-init.sh
RUN sed -i 's/\r$//' /docker-start.sh && chmod +rx /docker-start.sh
# Setup non-root user
RUN apt-get update --fix-missing && apt-get install -qy --no-install-recommends sudo
RUN groupadd -g 1000 dev && \
useradd -c "Dev Datatracker User" -u 1000 -g dev -m -s /bin/false dev && \
adduser dev sudo && \
echo "dev ALL=(ALL:ALL) NOPASSWD: ALL" | tee /etc/sudoers.d/dev
# Switch to local dev user
USER dev:dev
# Install current datatracker python dependencies
COPY requirements.txt /tmp/pip-tmp/
RUN pip3 --disable-pip-version-check --no-cache-dir install --user --no-warn-script-location -r /tmp/pip-tmp/requirements.txt
RUN pip3 --disable-pip-version-check --no-cache-dir install --user --no-warn-script-location pylint pylint-common pylint-django
RUN sudo rm -rf /tmp/pip-tmp
VOLUME [ "/assets" ]