Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Local setup using no env file #641

Open
ServerGeek82 opened this issue Apr 24, 2023 · 9 comments
Open

Local setup using no env file #641

ServerGeek82 opened this issue Apr 24, 2023 · 9 comments
Labels
Support Requests for Help regarding setup and usage

Comments

@ServerGeek82
Copy link

Followed setup located here:
https://www.linkace.org/docs/v1/setup/setup-with-docker/advanced-configuration/

Followed steps in this section on that page:
"Using Docker environment variables instead of the .env file"
Step1: Removed volume mount of file
Step2: Added env variables to compose file
Step3:
Step3a: Done
Step3b: Done
Step3c: Done
Step4: Using MariaDB

Initial launch successful, however

URL: http://myLocalIP:8187/setup/requirements

PHP version >= 7.4.0 : Checkmark
PHP Extension: BCMath : Checkmark
PHP Extension: Ctype : Checkmark
PHP Extension: JSON : Checkmark
PHP Extension: Mbstring : Checkmark
PHP Extension: OpenSSL : Checkmark
PHP Extension: PDO : Checkmark
PHP Extension: Tokenizer : Checkmark
PHP Extension: XML : Checkmark
.env file is present and writable : SadPanda
/storage and /storage/logs directories are writable : Checkmark

Enter the boring stuff:

services:
  linkace-db:
    image: mariadb:10.7
    container_name: linkace-db
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
    environment:
      PGID: 1000
      PUID: 1000
      TZ: "Earth"
      UMASK_SET: 002
      MYSQL_ROOT_PASSWORD: ChangeThisToASecurePassword!
      MYSQL_USER: linkace
      MYSQL_PASSWORD: ChangeThisToASecurePassword!
      MYSQL_DATABASE: linkace
    labels:
      - "traefik.enable=false"
    restart: unless-stopped
    volumes:
      - /home/docker/nonVolumes/linkace-db:/var/lib/mysql
    networks:
      - mxprod01io

  linkace-app:
    image: linkace/linkace:simple
    container_name: linkace-app
    depends_on:
      - linkace-db
    environment:
      PGID: 1000
      PUID: 1000
      TZ: "Earth"
      UMASK_SET: 002
      APP_KEY: base64:UpNqL+sGLU6ckAzczF3QcFsrQzv/jHFypRp8fGnNX6s=
      ## Configuration of the database connection
      ## Attention: Those settings are configured during the web setup, please do not modify them now.
      # Set the database driver (mysql, pgsql, sqlsrv, sqlite)
      DB_CONNECTION: mysql
      DB_HOST: linkace-db
      DB_PORT: 3306
      DB_DATABASE: linkace
      DB_USERNAME: linkace
      DB_PASSWORD: ChangeThisToASecurePassword!
    labels:
     - "traefik.enable=false"
    restart: unless-stopped
    ports:
      - "0.0.0.0:8187:80"
    volumes:
      - /home/docker/nonVolumes/linkace-app:/app/storage/logs"
    networks:
      - mxprod01io

networks:
  mxprod01io:
    external: true

Is there a env variable to let the app know that we are choosing this option and skip check for file?

@ServerGeek82
Copy link
Author

Posting this as i didn't see any work around already posted. I put a dummy .env file as a mount with BLANKFILE inside the file. Allowed me to finish setup.

@Alfablos
Copy link

I was wondering the same: I'm running this on Kubernetes and it feels weird to mount configuration files.

Posting this as i didn't see any work around already posted. I put a dummy .env file as a mount with BLANKFILE inside the file. Allowed me to finish setup.

Does this really work?! :)

Anyway I'm loving this app!

@ServerGeek82
Copy link
Author

Container is still up and running. So workaround works. Shall see in the next server reboot.

@Jurrer
Copy link

Jurrer commented Aug 15, 2023

I can confirm, you have to mount a writable .env file just for initial checks and setup. Afterwards app works without any file mounted.
That .env can be just a BLANKFILE.

@Drallas
Copy link

Drallas commented Sep 20, 2023

I need something like this:

  • /var/lib/docker/volumes/linkace_linkace_env/_data/.env:/app/.env

But seems a bit odd, must be better ways to setup the app.

@Kovah Kovah added the Support Requests for Help regarding setup and usage label Nov 1, 2023
@black-backdoor
Copy link

black-backdoor commented Dec 30, 2023

Did you find a way?

If I mount a blank file to the .env path, it gives me an internal server error

Note:
the .env file is not in the same folder as the docker-compose.yml

@ServerGeek82
Copy link
Author

ServerGeek82 commented Dec 30, 2023

So here is my Docker compose file

services:
  linkace-db:
    image: mariadb:10.7
    container_name: linkace-db
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
    environment:
      PGID: 1000
      PUID: 1000
      TZ: "America/Phoenix"
      UMASK_SET: 002
      MYSQL_ROOT_PASSWORD: ChangeThisToASecurePassword!
      MYSQL_USER: linkace
      MYSQL_PASSWORD: ChangeThisToASecurePassword!
      MYSQL_DATABASE: linkace
    labels:
      - "traefik.enable=false"
    restart: unless-stopped
    ports:
      - "3308:3306"
    volumes:
      - /home/docker/nonVolumes/linkace-db:/var/lib/mysql
    networks:
      - linkace-net

  linkace-app:
    image: linkace/linkace:simple
    container_name: linkace-app
    depends_on:
      - linkace-db
    environment:
      PGID: 1000
      PUID: 1000
      TZ: "America/Phoenix"
      UMASK_SET: 002
      APP_KEY: base64:UpNqL+sGLU6ckAzczF3QcFsrQzv/jHFypRp8fGnNX6s=
      ## Configuration of the database connection
      ## Attention: Those settings are configured during the web setup, please do not modify them now.
      # Set the database driver (mysql, pgsql, sqlsrv, sqlite)
      DB_CONNECTION: mysql
      DB_HOST: linkace-db
      DB_PORT: 3308
      DB_DATABASE: linkace
      DB_USERNAME: linkace
      DB_PASSWORD: ChangeThisToASecurePassword!
    labels:
      - "traefik.enable=false"
    restart: unless-stopped
    ports:
      - "8187:80"
    volumes:
      - /home/docker/nonVolumes/linkace-app/env/.env:/app/.env
      - /home/docker/nonVolumes/linkace-app/app:/app/storage/logs"
    networks:
      - linkace-net

networks:
  linkace-net:
    external: true```

@black-backdoor
Copy link

So here is my Docker compose file

`--- services: linkace-db: image: mariadb:10.7 container_name: linkace-db command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin environment: PGID: 1000 PUID: 1000 TZ: "America/Phoenix" UMASK_SET: 002 MYSQL_ROOT_PASSWORD: ChangeThisToASecurePassword! MYSQL_USER: linkace MYSQL_PASSWORD: ChangeThisToASecurePassword! MYSQL_DATABASE: linkace labels: - "traefik.enable=false" restart: unless-stopped ports: - "3308:3306" volumes: - /home/docker/nonVolumes/linkace-db:/var/lib/mysql networks: - linkace-net

linkace-app: image: linkace/linkace:simple container_name: linkace-app depends_on: - linkace-db environment: PGID: 1000 PUID: 1000 TZ: "America/Phoenix" UMASK_SET: 002 APP_KEY: base64:UpNqL+sGLU6ckAzczF3QcFsrQzv/jHFypRp8fGnNX6s= ## Configuration of the database connection ## Attention: Those settings are configured during the web setup, please do not modify them now. # Set the database driver (mysql, pgsql, sqlsrv, sqlite) DB_CONNECTION: mysql DB_HOST: linkace-db DB_PORT: 3308 DB_DATABASE: linkace DB_USERNAME: linkace DB_PASSWORD: ChangeThisToASecurePassword! labels: - "traefik.enable=false" restart: unless-stopped ports: - "8187:80" volumes: - /home/docker/nonVolumes/linkace-app/env/.env:/app/.env - /home/docker/nonVolumes/linkace-app/app:/app/storage/logs" networks: - linkace-net

networks: linkace-net: external: true`

thanks

next time use ``` to create a multiline code ;)

@ServerGeek82
Copy link
Author

updated thank you. its still early

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Support Requests for Help regarding setup and usage
Projects
None yet
Development

No branches or pull requests

6 participants