Fix Docker stuff

This commit is contained in:
2021-10-29 02:07:55 +02:00
parent 5dea20803b
commit 578c6eb525
3 changed files with 13 additions and 6 deletions

1
.env.example Normal file
View File

@ -0,0 +1 @@
DOMAIN=https://i.example.com/

View File

@ -14,6 +14,15 @@ RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
FROM python:3.9-slim
# TODO: Remove this
# We don't want apt-get to interact with us,
# and we want the default answers to be used for all questions.
ARG DEBIAN_FRONTEND=noninteractive
# Update packages and install needed packages to build our requirements.
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential ffmpeg
# Create user so we don't run as root.
RUN useradd --create-home botuser
@ -28,8 +37,6 @@ WORKDIR /home/botuser
ENV PATH "$PATH:/home/botuser/.local/bin"
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
# Copy our Python application to our home directory.
COPY --from=requirements-stage /tmp/requirements.txt /home/botuser/requirements.txt
@ -51,11 +58,8 @@ ENV PYTHONUNBUFFERED 1
# Use our virtual environment that we created in the other stage.
ENV PATH="/opt/venv/bin:$PATH"
# Make the website accessible outside localhost
ENV FLASK_RUN_HOST=0.0.0.0
# Expose the web port
EXPOSE 5000
# Run bot.
CMD ["uvicorn", "main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
CMD ["uvicorn", "main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "5000"]

View File

@ -3,6 +3,8 @@ services:
discord-nice-embed-maker-for-my-yoy:
image: thelovinator/discord-nice-embed-maker-for-my-yoy
container_name: discord-nice-embed-maker-for-my-yoy
env_file:
- .env
environment:
- DOMAIN=${DOMAIN}
ports: