diff --git a/Dockerfile b/Dockerfile index 5e6cf4e..391a633 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,11 @@ -FROM python:3 -ENV PYTHONUNBUFFERED 1 -#RUN apt-get update \ -# && apt-get install -y python-mysqldb - -RUN mkdir /code -WORKDIR /code -ADD src/requirements.txt /code/ -RUN pip install -r requirements.txt -ADD . /code/ +FROM debian:latest +RUN apt-get update +RUN apt-get -y upgrade +RUN apt-get -y install openjdk-8-jre openjdk-8-jdk +WORKDIR /bot_src +ADD . /bot_src/ +RUN chmod +x gradlew +ENV PORT=8080 +ENV TOKEN=10 +RUN ./gradlew build +CMD java -jar build/libs/DiscordBot-0.1.0.jar -t ${TOKEN} diff --git a/docker-compose.yml b/docker-compose.yml index 7322633..5f76d46 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,26 +1,22 @@ -version: '3' +version: '2' services: - web: - build: . - command: python3 manage.py runserver 0.0.0.0:8000 - volumes: - - ./src:/code - ports: - - "8000:8000" - depends_on: - - database - phpmyadmin: - image: phpmyadmin/phpmyadmin:latest - ports: - - "8001:80" - depends_on: - - database - env_file: - - pma.env - database: - image: mariadb:latest - volumes: - - ./db:/var/lib/mysql - env_file: - - database.env + botdiscord: + build: . + networks: + - proxy + environment: + - PORT=8081 + - TOKEN=1111111111111 #CHANGE ME! + labels: + - "traefik.frontend.rule=Host:discord.seb6596.ovh" + - "traefik.port=8080" + - "traefik.backend=botdiscord" + - "traefik.frontend.entryPoints=http,https" + #volumes: + # - "/var/run/docker.sock:/var/run/docker.sock" + restart: always + +networks: + proxy: + external: true