working on db initial create
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -17,7 +17,9 @@ RUN mkdir -p /app/instance/data
|
||||
COPY app.py /app
|
||||
COPY requirements.txt /app
|
||||
COPY models.py /app
|
||||
COPY init_db.py /app/init_db.py
|
||||
COPY entrypoint.sh /app
|
||||
COPY init_db.py /app
|
||||
|
||||
|
||||
# Install any needed packages specified in requirements.txt
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
@@ -26,6 +28,7 @@ RUN apk del .build-deps
|
||||
|
||||
# ---- Production Stage ----
|
||||
FROM python:3.8-alpine3.18 as production
|
||||
RUN apk add --upgrade --no-cache bash
|
||||
|
||||
# Create a user to run our application
|
||||
RUN adduser -D myuser -u 1000
|
||||
@@ -35,10 +38,19 @@ 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
|
||||
# Set script to be executable
|
||||
RUN chmod +x /app/entrypoint.sh
|
||||
|
||||
# Switch to the created user
|
||||
USER myuser
|
||||
|
||||
RUN ls -l /app
|
||||
RUN ls -l /
|
||||
|
||||
# Set the script as the entrypoint
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
|
||||
# Start gunicorn with the appropriate options
|
||||
CMD ["gunicorn", "-b", "0.0.0.0:3000", "--log-level=debug", "--workers=3", "app:app"]
|
||||
|
||||
Reference in New Issue
Block a user