Skip to content

Commit 905fecd

Browse files
authored
Réparer le docker compose (#1783)
* update betagouv/transport container to latest version * add git to fetch dependencies from github * update wait for it script * add test for docker compose base image * add note about Antoine's db image use * add an .env.example file * update readme for docker instructions
1 parent 85c955a commit 905fecd

File tree

5 files changed

+29
-3
lines changed

5 files changed

+29
-3
lines changed

.env.example

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SECRET_KEY_BASE="SOME-LONG-SECRET-KEY-BASE-FOR-TESTING-SOME-LONG-SECRET-KEY-BASE-FOR-TESTING"
2+
3+
GTFS_VALIDATOR_URL=https://transport-validator.cleverapps.io
4+
5+
DATAGOUVFR_SITE=https://demo.data.gouv.fr
6+
DATAGOUVFR_REDIRECT_URI=http://localhost:5000/login/callback
7+
DATAGOUVFR_CLIENT_SECRET=
8+
DATAGOUVFR_CLIENT_ID=
9+
DATAGOUVFR_API_KEY=
10+
11+
12+
# Optional ----------------------
13+
CELLAR_ACCESS_KEY_ID=
14+
CELLAR_SECRET_ACCESS_KEY=
15+
16+
MJ_APIKEY_PUBLIC=
17+
MJ_APIKEY_PRIVATE=
18+
19+
JCDECAUX_APIKEY=
20+
# -------------------------------

Dockerfile.dev

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
FROM betagouv/transport:0.4.3
1+
FROM betagouv/transport:elixir-1.12.2-erlang-24.0.3-alpine-3.13.3
22

33
RUN apk add inotify-tools
44
RUN apk add postgresql-client>=11
5+
RUN apk add git
56

67
RUN mkdir /app/
78
RUN mkdir /app/_build
89
RUN mkdir /app/deps/
910
WORKDIR /app/
1011

1112
# fetch a wait-for-it script to wait for postgres startup
12-
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/54d1f0bfeb6557adf8a3204455389d0901652242/wait-for-it.sh /opt/bin/
13+
ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/81b1373f17855a4dc21156cfe1694c31d7d1792e/wait-for-it.sh /opt/bin/
1314
RUN chmod +x /opt/bin/wait-for-it.sh
1415

1516
ADD docker_phoenix_startup.sh /docker_phoenix_startup.sh

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ To run a custom task: `mix <custom task>`
152152

153153
If you don't plan to work a lot on this project, the docker installation is way easier.
154154

155-
You need a .env file with the same variables that you have in .envrc.example (but you'll need to remove `export` at the beginning of each line.
155+
You need a .env file, and can use .env.example to see which variables need to be set.
156156
(No need to setup the variable `PG_URL`, it is defined in the docker-compose.yml)
157157

158158
Then you only need to run:

apps/transport/test/build_test.exs

+4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ defmodule TransportWeb.BuildTest do
3737
content = File.read!("../../Dockerfile")
3838
[[_, production_version]] = Regex.scan(~r/FROM (.*)/, content)
3939

40+
content = File.read!("../../Dockerfile.dev")
41+
[[_, docker_compose_version]] = Regex.scan(~r/FROM (.*)/, content)
42+
4043
content = File.read!("../../.circleci/config.yml")
4144
[[_, ci_version]] = Regex.scan(~r/(betagouv\/transport.*)/, content)
4245

4346
assert ci_version == production_version
47+
assert ci_version == docker_compose_version
4448
end
4549

4650
# figuring out you have forgotten to upgrade the assets can be tricky, so we add a little reminder here

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
version: "3"
22
services:
33
database:
4+
# this will need to be replaced, as the DB content is now really old
45
image: antoinede/transport_data_gouv_dev_database
56
volumes:
67
- pgdata:/var/lib/postgresql/data

0 commit comments

Comments
 (0)