fix(docker): correct port mapping and improve container startup
Some checks failed
Build and Push Docker Image (Gitea) / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image (Gitea) / build-and-push (push) Has been cancelled
- Fix port mapping from 5001:5001 to 5001:5000 to match internal application port - Add entrypoint script for proper database initialization and seeding - Set PORT environment variable to 5000 for consistency - Update Dockerfile to use entrypoint script with proper line ending handling
This commit is contained in:
@@ -17,8 +17,12 @@ COPY . .
|
||||
# Create data directory
|
||||
RUN mkdir -p /app/data
|
||||
|
||||
# Expose port
|
||||
EXPOSE 5001
|
||||
# Fix line endings for entrypoint script (in case of Windows checkout) and make executable
|
||||
RUN sed -i 's/\r$//' entrypoint.sh && \
|
||||
chmod +x entrypoint.sh
|
||||
|
||||
# Run commands to init db, seed data, and start server
|
||||
CMD ["sh", "-c", "flask init-db && flask seed-db && gunicorn -w 4 -b 0.0.0.0:5001 app:app"]
|
||||
# Expose port (default 5000)
|
||||
EXPOSE 5000
|
||||
|
||||
# Use entrypoint script to init db, seed data, and start server
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user