Skip to content

Migrating from an all-in-one to a docker compose installation #107

@awa5114

Description

@awa5114

I have been using local instance of OpenProject on my windows machine which I installed using the all-in-one configuration. The Dockerfile for the image I'm using contains the following:

FROM openproject/openproject:15

ENV OPENPROJECT_SECRET_KEY_BASE=resing123
ENV OPENPROJECT_HOST__NAME=localhost:8080
ENV OPENPROJECT_HTTPS=false
ENV OPENPROJECT_DEFAULT__LANGUAGE=en

I then build and run as follows:

PS > docker build .
PS> docker run -it -p 8080:80 -v $TEMP/openproject/pgdata:/var/openproject/pgdata -v $TEMP/openproject/assets:/var/openproject/assets openproject-all-in-one:latest

After using this open project instance for a while, I am now attempting to migrate to the Docker Compose installation. I cloned the repo and copied the .env.example file as indicated by the docs.

PS> git clone https://github.com/opf/openproject-deploy --depth=1 --branch=stable/15 openproject
PS> cp .env.example .env

I then tried tweaking the .env file to mimic the environment I had with the all-in-one installation, including mapping the volumes to the same directories where the all-in-one installation was storing data.

TAG=15-slim
OPENPROJECT_HTTPS=false
OPENPROJECT_HOST__NAME=localhost
PORT=127.0.0.1:8080
IMAP_ENABLED=false
DATABASE_URL="postgres://openproject:openproject@127.0.0.1/openproject"
OPENPROJECT_SECRET_KEY_BASE=resing123
RAILS_MIN_THREADS=4
RAILS_MAX_THREADS=16
PGDATA="C:/Users/admin/Desktop/TEMP/openproject/pgdata"
OPDATA="C:/Users/admin/Desktop/TEMP/openproject/assets"
POSTGRES_PASSWORD=""
# All-in-one connection string:\
# postgres://openproject:openproject@127.0.0.1/openproject
DATABASE_URL="postgres://openproject:openproject@db/openproject?pool=20&encoding=unicode&reconnect=true"

Unfortunately, when I try to docker compose up the above, I observe the following behaviors:

  • the seeder service keeps on exiting with exit code 2 and restarting over and over again
  • The web-1 service throws errors that look like this:
 | /app/vendor/bundle/ruby/3.3.0/gems/pg-1.5.9/lib/pg/connection.rb:709:in `async_connect_or_reset': connection to server at "172.18.0.4", port 5432 failed: Connection refused (PG::ConnectionBad)
  • The worker-1 service throws errors that look like this:
| /app/vendor/bundle/ruby/3.3.0/gems/activerecord-7.1.5.1/lib/active_record/connection_adapters/postgresql_adapter.rb:80:in `rescue in new_client': connection to server at "172.18.0.4", port 5432 failed: Connection refused (ActiveRecord::ConnectionNotEstablished)
|   Is the server running on that host and accepting TCP/IP connections?

Being a bit of a noob when it comes to Docker, I would appreciate some help or pointers on what I may be doing wrong. Thanks in advance.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions