-
Notifications
You must be signed in to change notification settings - Fork 61
/
Dockerfile
35 lines (26 loc) · 899 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Choose a base Python image
FROM python:3.11.3-slim-buster
LABEL maintainer="https://github.com/snaacky/dndserver"
# Install Poetry
RUN apt update -y
RUN apt install --no-install-recommends -y curl
RUN curl -sSL https://install.python-poetry.org | python -
# Add Poetry path to PATH
ENV PATH="${PATH}:/root/.local/bin"
# Install project dependencies with Poetry
COPY pyproject.toml .
RUN poetry config virtualenvs.create false
RUN poetry install --no-interaction --no-ansi --only main --all-extras
# Place where the app lives in the container
WORKDIR /app
COPY . .
# Copy the config for the migrations
COPY config.example.yml config.yml
# Run database migrations
RUN alembic upgrade head
# Remove the config now that the migrations are done
RUN rm config.yml
# Expose the port your application will run on
EXPOSE 13337
# Set the entrypoint
ENTRYPOINT ["python", "-m", "dndserver.server"]