Unable to use Postgres Database as storage in Docker
woongzeyi opened this issue · 4 comments
woongzeyi commented
Situation
I followed the instruction to create a haste server Docker image and failed to deployed it alongside with a Postgres database, both connected to a Docker network.
I received an exception and a complete log from the program.
Steps to reproduce
- Install Docker in an Ubuntu OS version 20.04.2 LTS system
- Create a Docker network.
docker network create haste-network
- Git clone this repo into a temporary folder, cd into where the Dockerfile is located and run
docker build --tag haste-server .
to build into an image. Now you get a haste-server Docker image. - Pull Postgres image from docker with
docker pull postgres
. Deploy it with the following command:
docker run --name haste-database -e POSTGRES_PASSWORD=hastenetwork -d --network haste-network postgres
- Bash into Postgres database.
docker run -it --rm --network haste-network postgres psql -h haste-database -U postgres
- Create table in database.
create table entries (id serial primary key, key varchar(255) not null, value text not null, expiration int, unique(key));
- Exit from bash and deploy haste-server with command:
docker run --name haste --network haste-network -d -p 7778:7777 --env STORAGE_TYPE=postgres --env STORAGE_HOST=172.18.0.2 --env STORAGE_PORT=5432 --env STORAGE_DB=postgres --env STORAGE_PASSWORD=hastenetwork --env STORAGE_USERNAME=postgres haste-server
- Run
docker logs haste
and now you'll see the exception being popped out.
likwidoxigen commented
Hey there,
Neither your exception nor your logs are available to be viewed. In this context I'd suggest combining them into one Gist and linking that way.
konstrybakov commented
Please provide logs and an exception that you are encountering
github-actions commented
This issue is stale because it has been open for 30 days with no activity.
github-actions commented
This issue was closed because it has been inactive for 14 days since being marked as stale.