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

Docker: Loosing uploads after each deploy #16

Closed
drupol opened this issue Nov 17, 2022 · 4 comments
Closed

Docker: Loosing uploads after each deploy #16

drupol opened this issue Nov 17, 2022 · 4 comments

Comments

@drupol
Copy link

drupol commented Nov 17, 2022

Hello,

Everytime I deploy a new update of the app, the uploaded presentation stored in upload gets lost.
How can I prevent that ? I guess I have to add a volume in Docker, but what is the directory in the application to use then?

Thanks.

@drupol
Copy link
Author

drupol commented Nov 17, 2022

Looks like adding:

volumes:
  - uploads:/app/priv/static/uploads

Is fixing the issue.

@drupol drupol closed this as completed Nov 17, 2022
@drupol
Copy link
Author

drupol commented Nov 18, 2022

(maybe this should be documented by the way)

@lordbagel42
Copy link

@drupol how did you get docker to work? I can't seem to get it working.

@drupol
Copy link
Author

drupol commented Jan 14, 2023

I'm using Nix for this, and this is what I had to do to setup Claper on my server, nothing else:

{ config, pkgs, ... }:

{
  config.virtualisation.oci-containers.containers = {
    claper = {
      image = "ghcr.io/claperco/claper:main";
      ports = [
        "4000:4000"
      ];
      environment = {
        DATABASE_URL = "postgres://claper:claper@LOCAL-IP:5432/claper";
        SECRET_KEY_BASE = "SECRET-KEY-BASE";
        ENDPOINT_HOST = "claper.my-public-hostname.com";
      };
      dependsOn = [ "db" ];
      volumes = [
        "uploads:/app/priv/static/uploads"
      ];
    };
    db = {
      image = "postgres:9";
      ports = [
        "5432:5432"
      ];
      environment = {
        POSTGRES_PASSWORD = "password";
        POSTGRES_USER = "password";
        POSTGRES_DB = "password";
      };
    };
  };
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants