fixed docker db init
This commit is contained in:
@@ -25,6 +25,9 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
# Copy the rest of the application
|
# Copy the rest of the application
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Make entrypoint script executable
|
||||||
|
RUN chmod +x /app/docker-entrypoint.sh
|
||||||
|
|
||||||
# Create volume for persistent database storage
|
# Create volume for persistent database storage
|
||||||
VOLUME ["/app/instance"]
|
VOLUME ["/app/instance"]
|
||||||
|
|
||||||
@@ -37,4 +40,4 @@ USER myuser
|
|||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
|
|
||||||
# Command to run the application
|
# Command to run the application
|
||||||
CMD ["gunicorn", "-c", "gunicorn.conf.py", "app:app"]
|
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||||
|
|||||||
7
docker-entrypoint.sh
Executable file
7
docker-entrypoint.sh
Executable file
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Initialize the database using init_db.py
|
||||||
|
python init_db.py
|
||||||
|
|
||||||
|
# Start gunicorn
|
||||||
|
exec gunicorn -c gunicorn.conf.py app:app
|
||||||
Reference in New Issue
Block a user