Skip to content

Commit

Permalink
Docker Works now
Browse files Browse the repository at this point in the history
  • Loading branch information
SirGankalot committed May 9, 2024
1 parent b1a1b4d commit bbc8b4f
Show file tree
Hide file tree
Showing 20 changed files with 12 additions and 232 deletions.
24 changes: 5 additions & 19 deletions service/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
# Use a suitable base-image.
FROM python:3-alpine

# Create a seperate user and chown new directories if necessary
RUN addgroup --system service
RUN adduser --system --ingroup service --uid 1000 service

# Create our mapped data volume endpoint
RUN mkdir /data/

# Copy our entrypoint.sh and make it executable
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
FROM python:3.10.9-slim

# Copy our service
COPY src/ /service/
COPY src/ /src/
COPY main.py /

# Change the working directory.
WORKDIR /service/
# Expose the service's port
EXPOSE 8000
RUN pip install -r src/requirements.txt

# Run the service
ENTRYPOINT ["/entrypoint.sh"]
CMD gunicorn --bind 0.0.0.0:5000 main:app
14 changes: 6 additions & 8 deletions service/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
version: '3'
services:
n0t3b00k:
build: .
# The code should be copied into the container using COPY.
# Mount the data folder writable, so that information can be persisted across restarts.
service:
build:
context: .
volumes:
- ./data/:/data:rw
# Define the port mapping (external:internal port)
- ./instance:/instance
# change port later
ports:
- "2323:8000"
- "5000:5000"
2 changes: 1 addition & 1 deletion service/src/FlaskWebsite/main.py → service/main.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from website import create_app
from src import create_app

app = create_app()

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
204 changes: 0 additions & 204 deletions service/src/n0t3b00k.py

This file was deleted.

Binary file added service/src/requirements.txt
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit bbc8b4f

Please sign in to comment.