Skip to content

Commit

Permalink
Update Dockerfile for tauschen
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Feb 29, 2024
1 parent 097fd24 commit bf5b18b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions tauschen/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tauschen/tauschen-frontend/node_modules
19 changes: 9 additions & 10 deletions tauschen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
FROM debian:buster AS base
FROM debian:bookworm-slim AS base

ARG TAUSCHEN_PATH=./tauschen
ARG DIRECTORY_PATH=./directory

# Install normal dependencies
RUN apt-get update
RUN apt-get -y --no-install-recommends install 'g++' gcc make wget uwsgi uwsgi-plugin-python3 python3 libldap2-dev libsasl2-dev libssl-dev python3-dev python3-pip python3-setuptools
RUN pip3 install wheel
RUN apt-get -y --no-install-recommends install 'g++' gcc make wget uwsgi uwsgi-plugin-python3 python3 libldap2-dev libsasl2-dev libssl-dev python3-dev python3-pip python3-setuptools python3-wheel
RUN pip3 install --break-system pipenv

# Clean apt
RUN apt-get -y autoremove
Expand All @@ -17,25 +17,24 @@ ADD $DIRECTORY_PATH /opt/directory
ADD $TAUSCHEN_PATH/tauschen-backend /opt/tauschen/tauschen-backend

# Setup backend
RUN pip3 install sentry-sdk uWSGI
RUN pip3 install -r /opt/tauschen/tauschen-backend/requirements.txt
WORKDIR /opt/tauschen/tauschen-backend
RUN ln -sf /opt/config/settings.py /opt/tauschen/tauschen-backend/tauschen/settings.py
RUN pip3 install /opt/directory
RUN pipenv requirements > requirements.txt
RUN pip3 install --break-system-packages /opt/directory -r requirements.txt

FROM base as frontend
ARG TAUSCHEN_PATH=./tauschen
# Install nodejs
RUN apt-get -y install npm
RUN yes no | npm install yarn @angular/cli --global

# Build frontend
ADD $TAUSCHEN_PATH/tauschen-frontend /opt/tauschen/tauschen-frontend
WORKDIR /opt/tauschen/tauschen-frontend
RUN yarn install
RUN ng build --prod --subresource-integrity --optimization --aot --source-map
RUN npm install
RUN npm run build

FROM base as final
COPY --from=frontend /opt/tauschen/tauschen-frontend/dist/tauschen-frontend/ /opt/tauschen/tauschen-frontend/dist/tauschen-frontend/
COPY --from=frontend /opt/tauschen/tauschen-frontend/dist/ /opt/tauschen/tauschen-frontend/dist/tauschen-frontend/
ADD start.sh /usr/local/bin/run
ADD uwsgi-tauschen.ini /etc/uwsgi/tauschen.ini

Expand Down

0 comments on commit bf5b18b

Please sign in to comment.