diff --git a/solutions/dockerfiles/Dockerfile.back.alpine b/solutions/dockerfiles/Dockerfile.back.alpine new file mode 100644 index 0000000000000000000000000000000000000000..573ac01c6321bba742fb424f26ce1321697fecc3 --- /dev/null +++ b/solutions/dockerfiles/Dockerfile.back.alpine @@ -0,0 +1,15 @@ +FROM python:3.8-alpine3.15 +WORKDIR /back/ + +# Required apk packages for building of mysqlclient and cffi python packages +RUN apk update \ + && apk add --virtual build-deps gcc musl-dev mariadb-dev libffi-dev + +COPY requirements.txt /back/ +RUN pip install -r requirements.txt + +# Remove apk packages that were only necessary at build time +RUN apk del build-deps + +COPY ./ /back/ +ENTRYPOINT python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000 diff --git a/solutions/dockerfiles/Dockerfile.back.debian b/solutions/dockerfiles/Dockerfile.back.debian new file mode 100644 index 0000000000000000000000000000000000000000..c65e43484e1ba71e789ae12483fb526ad32c2ec4 --- /dev/null +++ b/solutions/dockerfiles/Dockerfile.back.debian @@ -0,0 +1,8 @@ +FROM python:3.8 +WORKDIR /back/ + +COPY requirements.txt /back/ +RUN pip install -r requirements.txt + +COPY ./ /back/ +ENTRYPOINT python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000 diff --git a/solutions/dockerfiles/Dockerfile.front.nonroot b/solutions/dockerfiles/Dockerfile.front.nonroot new file mode 100644 index 0000000000000000000000000000000000000000..8c5cfd05390a87123251cf6c637b9e40f9c226cd --- /dev/null +++ b/solutions/dockerfiles/Dockerfile.front.nonroot @@ -0,0 +1,15 @@ +FROM node:16 + +WORKDIR /front/ + +COPY package.json package-lock.json /front/ +RUN npm install + +COPY src/ /front/src/ +COPY public/ /front/public/ +COPY .env /front/ +RUN npm run build + +FROM nginxinc/nginx-unprivileged + +COPY --from=0 /front/build/ /usr/share/nginx/html/