szabodanika / microbin

A secure, configurable file-sharing and URL shortening web app written in Rust.
https://microbin.eu
BSD 3-Clause "New" or "Revised" License
2.66k stars 167 forks source link

Some of the .env variables are missing in docker compose file #234

Open TissuePowder opened 11 months ago

TissuePowder commented 11 months ago

Microbin's port from docker's internal network wasn't being published to the host at all, even though "${MICROBIN_PORT}:8081" was set clearly in compose file. Then I noticed the MICROBIN_PORT wasn't listed under environment in compose file, so it was just trying to forward an undefined/garbage port to the host. And not just that, I believe a few other variables might be missing as well.

Why do you list each variables separately like that though? It would be better and easier if you just link the .env file in the docker compose file, like this

version: "2"
services:
  microbin:
    image: danielszabo99/microbin:latest
    restart: always
    ports:
      - "${MICROBIN_PORT}:8081"
    env_file:
      - .env
    volumes:
     - /var/local/microbin-data:/app/microbin_data

Note that when using the env file like this, we will no longer need the export keyword in the env file.

kwiniarski97 commented 11 months ago

Will be fixed by https://github.com/szabodanika/microbin/pull/229