-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
72 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,27 @@ | ||
FROM node:alpine | ||
|
||
FROM postgres:9.6-alpine | ||
|
||
LABEL AUTHOR="Nelson Herbin <[email protected]>" | ||
LABEL NAME=tricoteuses-db | ||
LABEL VERSION=1 | ||
|
||
RUN "wget http:https://data.senat.fr/data/ameli/ameli.zip \ | ||
unzip ameli.zip \ | ||
su \ | ||
su postgres \ | ||
RUN apk update && apk upgrade && \ | ||
apk add --no-cache git wget | ||
|
||
|
||
ADD ./_dumps _dumps/ | ||
WORKDIR _dumps | ||
RUN wget http:https://data.senat.fr/data/ameli/ameli.zip && \ | ||
unzip ameli.zip && \ | ||
mv var/opt/opendata/ameli.sql /_dumps/ | ||
|
||
# dropdb ameli | ||
# dropuser opendata | ||
# createuser -IPRS opendata | ||
# Enter password for new role: opendata | ||
# Enter it again: opendata | ||
# createdb -E utf-8 -O opendata ameli | ||
psql ameli < var/opt/opendata/ameli.sql \ | ||
exit \ | ||
rm -R var/ \ | ||
rm ameli.zip" | ||
#RUN ls | ||
#RUN psql ameli < ./_dumps/ameli.sql | ||
#RUN exit | ||
# RUN rm ameli.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
ls | ||
|
||
#psql -v ON_ERROR_STOP=1 -d ameli --username "$POSTGRES_USER" <<-EOSQL | ||
# CREATE EXTENSION IF NOT EXISTS "postgis"; | ||
# CREATE EXTENSION IF NOT EXISTS "unaccent"; | ||
#EOSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <<-EOSQL | ||
CREATE ROLE opendata WITH LOGIN PASSWORD 'ameli'; | ||
ALTER ROLE opendata CREATEDB; | ||
CREATE DATABASE ameli OWNER opendata ENCODING 'UTF8'; | ||
EOSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
cd /_dumps | ||
wget http:https://data.senat.fr/data/ameli/ameli.zip -O ameli.zip && \ | ||
unzip ameli.zip && \ | ||
ls && \ | ||
psql ameli < ./var/opt/opendata/ameli.sql | ||
#cd var/opt/opendata \ | ||
su postgres \ | ||
dropdb ameli \ | ||
dropuser opendata \ | ||
createuser -IPRS opendata \ | ||
createdb -E utf-8 -O ameli ameli \ | ||
exit \ | ||
|
||
#psql ameli < ./ameli.sql | ||
#su \ | ||
#su postgres \ | ||
#ropdb ameli \ | ||
#dropuser opendata \ | ||
#createuser -IPRS opendata \ | ||
# Enter password for new role: opendata | ||
# Enter it again: opendata | ||
#createdb -E utf-8 -O ameli ameli \ | ||
#psql ameli < /_dumps/ameli.sql \ | ||
#exit \ | ||
#rm -R var/ \ | ||
#rm ameli.zip; | ||
|
||
#if [ -f /_dumps/ameli.sql ]; then | ||
|
||
#fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters