Somewhat stable VAPID generation

This commit is contained in:
Matthew Raymer
2023-09-29 08:08:06 -04:00
parent ebebd2fce2
commit d2d4071c61
4 changed files with 22 additions and 8 deletions

View File

@@ -3,23 +3,23 @@ FROM python:3.8-alpine3.18 as builder
RUN apk update && apk upgrade
RUN apk add --no-cache --virtual .build-deps build-base git
RUN apk add bash libffi-dev tzdata --upgrade --no-cache
RUN apk add --upgrade --no-cache bash sqlite libffi-dev tzdata
ENV TZ America/New_York
# Set the working directory in the container to /app
WORKDIR /app
RUN mkdir -p /app/instance/data
# Copy the current directory contents into the container at /app
COPY app.py /app
COPY requirements.txt /app
COPY models.py /app
COPY init_db.py /app/init_db.py
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN python /app/init_db.py
RUN apk del .build-deps
@@ -33,9 +33,13 @@ RUN adduser -D myuser
WORKDIR /app
COPY --from=builder /app /app
COPY --from=builder /usr/local /usr/local
COPY --from=builder /usr/bin /usr/bin
RUN chown -R myuser:myuser /app
# Switch to the created user
USER myuser
RUN python3 init_db.py
# Start gunicorn with the appropriate options
CMD ["gunicorn", "-b", "0.0.0.0:3000", "--log-level=debug", "--workers=3", "app:create_app('default')"]