How to put the moodle in the docker of aws - docker

I am currently using ubuntu for EC2 and I have tested by docker in my laptop, it works perfectly, but when it is in EC2 with my putty that is using docker as the container, it cannot connect the server, it is rds in aws as well.
$ docker run -d --name moodle \
-p 8080:8080 -p 8443:8443 \
--env MOODLE_USERNAME=admin \
--env MOODLE_PASSWORD=password \
--env MOODLE_EMAIL=dreamorehk#gmail.com \
--env MOODLE_SITE_NAME=DreaMore \
--env MOODLE_DATABASE_TYPE=mysqli \
--env MOODLE_DATABASE_HOST=moodle-database.ccfdhd03ropx.ap-east-1.rds.amazonaws.com \
--env MOODLE_DATABASE_PORT_NUMBER=3306 \
--env MOODLE_DATABASE_NAME=moodle \
--env MOODLE_DATABASE_USER=moodleuser \
--env MOODLE_DATABASE_PASSWORD=moodle \
--volume moodle_data:/bitnami/moodle \
bitnami/moodle:latest

Related

Add cache to jwilder/nginx-proxy Docker

Im trying to activate the cache in docker jwilder/nginx-proxy.
here is my docker run :
docker run \
--detach \
--restart always \
--publish 80:80 \
--publish 443:443 \
--name nginx-proxy \
--network nginx-proxy \
--volume /var/run/docker.sock:/tmp/docker.sock:ro \
--volume nginx-certs:/etc/nginx/certs \
--volume nginx-vhost:/etc/nginx/vhost.d \
--volume nginx-html:/usr/share/nginx/html \
jwilder/nginx-proxy
and how i add Vhost :
docker run \
--detach \
--restart always \
--name dev-website-1\
--network nginx-proxy \
--env VIRTUAL_HOST=website-1.com \
--env LETSENCRYPT_HOST=website-1.com \
--env LETSENCRYPT_EMAIL="info#website-1.com" \
jhay/image-website-1:latest
Im wondering how to "configured a proxy_cache my-cache" like its explain in the doc ?
https://hub.docker.com/r/jwilder/nginx-proxy
Can i set the proxy_cache in the Dockerfile of jwilder/nginx-proxy when i build it ?
and after i add to the Dockerfile of website-1 when i build it ?
$ { echo 'proxy_cache my-cache;'; echo 'proxy_cache_valid 200 302 60m;'; echo 'proxy_cache_valid 404 1m;' } > /path/to/vhost.d/website-1_location
Thank you for your help

installing transmission on debian with docker: Missing container [duplicate]

This question already has answers here:
Why docker container exits immediately
(16 answers)
Closed 9 months ago.
I am new to this. I have installed docker on my Raspi. I am trying to install transmission on the docker. I use the following;
docker run --cap-add=NET_ADMIN -d \
--name=transmission \
-v /mnt/extDrive1:/data \
-v /etc/localtime:/etc/localtime:ro \
-e CREATE_TUN_DEVICE=true \
-e OPENVPN_PROVIDER=EXPRESSVPN \
-e OPENVPN_CONFIG=my_expressvpn_uk_-_london_udp \
-e OPENVPN_USERNAME=XXX\
-e OPENVPN_PASSWORD=XXX \
-e WEBPROXY_ENABLED=false \
-e LOCAL_NETWORK=192.168.0.0 \
--log-driver json-file \
--log-opt max-size=10m \
-p 9091:9091 \
haugene/transmission-openvpn
I go through the debug on https://haugene.github.io/docker-transmission-openvpn/debug/
All is fine until I get to the section 'Checking if Transmission is running'.
When I run docker ps, there are no containers in the list.
What have I done wrong? Ultimately, I am trying to access transmission through localhost:9091.
Edit: So I have made some progress, but still having issues;
docker start transmission temporarily. populates the container ID
docker exec -it <container-id> bash comes up with the following error:
Error response from daemon: Container XXXX is not running
It seems that container is exiting out as you are not running it in the detached mode. Try this:
docker run -itd --cap-add=NET_ADMIN -d \
--name=transmission \
-v /mnt/extDrive1:/data \
-v /etc/localtime:/etc/localtime:ro \
-e CREATE_TUN_DEVICE=true \
-e OPENVPN_PROVIDER=EXPRESSVPN \
-e OPENVPN_CONFIG=my_expressvpn_uk_-_london_udp \
-e OPENVPN_USERNAME=XXX\
-e OPENVPN_PASSWORD=XXX \
-e WEBPROXY_ENABLED=false \
-e LOCAL_NETWORK=192.168.0.0 \
--log-driver json-file \
--log-opt max-size=10m \
-p 9091:9091 \
haugene/transmission-openvpn

psql:/home/git/gitlab/db/structure.sql:9: ERROR: permission denied to create extension "btree_gist"

I installed docker-gitlab from here
Step 1. Launch a postgresql container
docker run --name gitlab-postgresql -d \
--env 'DB_NAME=gitlabhq_production' \
--env 'DB_USER=gitlab' --env 'DB_PASS=password' \
--env 'DB_EXTENSION=pg_trgm' \
--volume /srv/docker/gitlab/postgresql:/var/lib/postgresql \
sameersbn/postgresql:12-20200524
Step 2. Launch a redis container
docker run --name gitlab-redis -d \
--volume /srv/docker/gitlab/redis:/data \
redis:6.2
Step 3. Launch the gitlab container
docker run --name gitlab -d \
--link gitlab-postgresql:postgresql --link gitlab-redis:redisio \
--publish 10022:22 --publish 10080:80 \
--env 'GITLAB_PORT=10080' --env 'GITLAB_SSH_PORT=10022' \
--env 'GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alpha-numeric-string' \
--env 'GITLAB_SECRETS_SECRET_KEY_BASE=long-and-random-alpha-numeric-string' \
--env 'GITLAB_SECRETS_OTP_KEY_BASE=long-and-random-alpha-numeric-string' \
--volume /srv/docker/gitlab/gitlab:/home/git/data \
sameersbn/gitlab:14.8.0
But i got these errors from gitlab container:
database 'gitlabhq_production' already exists
2022-02-28T17:02:02.425099812Z psql:/home/git/gitlab/db/structure.sql:9: ERROR: permission denied to create extension "btree_gist"
2022-02-28T17:02:02.425125024Z HINT: Must be superuser to create this extension.
2022-02-28T17:02:02.426554719Z rake aborted!
2022-02-28T17:02:02.426575880Z failed to execute:
2022-02-28T17:02:02.426586706Z psql --set ON_ERROR_STOP=1 --quiet --no-psqlrc --file /home/git/gitlab/db/structure.sql --single-transaction gitlabhq_production
2022-02-28T17:02:02.426598928Z
2022-02-28T17:02:02.426609892Z Please check the output above for any errors and make sure that `psql` is installed in your PATH and has proper permissions.

Multiple bitnami pgpool-II container

Need clarification if this is doable. I have successfully ran Postgres with 2 containers namely master and slave. I would like to know if I can run more than one pgpool container ? If yes, is there any specific environment variables i need to set ?
Can I just take the below command and run in another pgpool VM ? My intention is to have a load balancer round robin between the 2 pgpool that connects to the backend of master (rw) and slave (ro).
docker run --detach --rm --name pgpool \
--network my-network \
--env PGPOOL_BACKEND_NODES=0:pg-0:5432,1:pg-1:5432 \
--env PGPOOL_SR_CHECK_USER=customuser \
--env PGPOOL_SR_CHECK_PASSWORD=custompassword \
--env PGPOOL_ENABLE_LDAP=no \
--env PGPOOL_POSTGRES_USERNAME=postgres \
--env PGPOOL_POSTGRES_PASSWORD=adminpassword \
--env PGPOOL_ADMIN_USERNAME=admin \
--env PGPOOL_ADMIN_PASSWORD=adminpassword \
bitnami/pgpool:latest

Run Jenkins on different port on a docker container

I'm trying to run Jenkins on docker by using a different port. By default Jenkins is running on port 8080, but this port is used by different service in my machine. I would like to run Jenkins on a different port.
I have used the following command without any success:
docker run \
-u root \
--rm \
-d \
--name jenkins \
-p 8081:8081 \
-p 50000:50000 \
--env JAVA_OPTS="--httpPort=8081" \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkinsci/blueocean
Any ideas?
--env JAVA_OPTS="--httpPort=8081" \
not JAVA_OPTS, change it like this:
-e JENKINS_OPTS="--httpPort=8081"
Use this:
docker run \
-u root \
--rm \
-d \
--name jenkins \
-p 8081:8080 \
-p 50000:50000 \
-v jenkins-data:/var/jenkins_home \
-v /var/run/docker.sock:/var/run/docker.sock \
jenkinsci/blueocean

Resources