use docker compose
This commit is contained in:
parent
2dd405a394
commit
622158ab5e
@ -10,10 +10,6 @@ RUN apt install parallel -y
|
||||
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.2.1/wait /wait
|
||||
RUN chmod +x /wait
|
||||
|
||||
RUN apt-get install -y postgresql-contrib libpq-dev postgis
|
||||
RUN apt-get install -y postgresql-12-postgis-3
|
||||
RUN apt-get install -y gdal-bin libspatialindex-dev libgeos-dev libproj-dev
|
||||
|
||||
RUN mkdir /colouring-london
|
||||
COPY app /colouring-london/app
|
||||
COPY migrations /colouring-london/migrations
|
||||
@ -28,13 +24,10 @@ RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
|
||||
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
|
||||
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
|
||||
|
||||
RUN service postgresql start
|
||||
COPY ./init-user-db.sh /docker-entrypoint-initdb.d/init-user-db.sh
|
||||
|
||||
RUN npm install -g npm@latest
|
||||
|
||||
WORKDIR ./colouring-london/app
|
||||
RUN npm install
|
||||
|
||||
EXPOSE 8080
|
||||
CMD /wait && PGPASSWORD=postgres PGDATABASE=colouringlondon PGUSER=dockeruser PGHOST=localhost PGPORT=5432 APP_COOKIE_SECRET=123456 npm start
|
||||
# CMD /wait && PGPASSWORD=postgres PGDATABASE=colouringlondon PGUSER=dockeruser PGHOST=localhost PGPORT=5432 APP_COOKIE_SECRET=123456 npm start
|
@ -15,12 +15,12 @@ services:
|
||||
- "8080:8080"
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: postgres:10.4
|
||||
image: postgres:14
|
||||
ports:
|
||||
- "5432:5432"
|
||||
# volumes:
|
||||
# - ./postgresdata:/var/lib/postgresql/data
|
||||
# - ./src/migrations/dbinit.sql:/docker-entrypoint-initdb.d/dbinit.sql
|
||||
volumes:
|
||||
- ./postgresdata:/var/lib/postgresql/data
|
||||
- ./colouring-london/init-user-db.sh:/docker-entrypoint-initdb.d/init-user-db.sh
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_USER: dockeruser
|
||||
|
@ -1,6 +1,12 @@
|
||||
#!/bin/bash
|
||||
sed -i "s/#\?listen_address.*/listen_addresses '*'/" /etc/postgresql/12/main/postgresql.conf
|
||||
echo "host all all all md5" | tee --append /etc/postgresql/12/main/pg_hba.conf > /dev/null
|
||||
service postgresql start
|
||||
|
||||
sudo apt-get install -y postgresql-contrib libpq-dev postgis
|
||||
sudo apt-get install -y postgresql-14-postgis-3
|
||||
sudo apt-get install -y gdal-bin libspatialindex-dev libgeos-dev libproj-dev
|
||||
|
||||
sed -i "s/#\?listen_address.*/listen_addresses '*'/" /etc/postgresql/14/main/postgresql.conf
|
||||
echo "host all all all md5" | tee --append /etc/postgresql/14/main/pg_hba.conf > /dev/null
|
||||
service postgresql restart
|
||||
|
||||
sudo -u postgres psql -c "SELECT 1 FROM pg_user WHERE usename = 'dockeruser';" | grep -q 1 || sudo -u postgres psql -c "CREATE ROLE dockeruser SUPERUSER LOGIN PASSWORD 'postgres';"
|
||||
|
Loading…
Reference in New Issue
Block a user