-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker: add a Docker setup #2349
Open
freesteph
wants to merge
1
commit into
gip-inclusion:staging
Choose a base branch
from
freesteph:feat/docker
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
node_modules | ||
.git | ||
.github | ||
.dockerignore | ||
Dockerfile | ||
docker-compose.yml | ||
tmp/** | ||
log/** | ||
.DS_STORE | ||
storage/** | ||
.local |
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,28 @@ | ||
FROM ruby:3.3.3-slim | ||
|
||
EXPOSE 3000 | ||
|
||
RUN apt-get update && apt-get upgrade -y && apt-get install --no-install-recommends -y build-essential libpq-dev nodejs npm git curl | ||
|
||
# do the bundle install in another directory with the strict essential | ||
# (Gemfile and Gemfile.lock) to allow further steps to be cached | ||
# (namely the NPM steps) | ||
WORKDIR /bundle | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install | ||
|
||
# Move to the main folder | ||
WORKDIR /app | ||
|
||
# We can't do the WORKDIR trick here because npm modules need to be | ||
# installed in the root folder (since they're installed locally in | ||
# node_modules) | ||
COPY package.json yarn.lock ./ | ||
|
||
RUN npm install -g yarn && yarn install | ||
|
||
COPY . . | ||
|
||
ENTRYPOINT ["./entrypoint.sh"] | ||
|
||
CMD ["bundle", "exec", "rails", "s", "-b", "0.0.0.0"] |
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
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
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,29 @@ | ||
services: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Dans le cas où on veut aller au-delà du POC et faire du dev faudra juste rajouter les workers ici) |
||
web: | ||
image: rdv-insertion-web | ||
build: . | ||
depends_on: | ||
- db | ||
env_file: | ||
- '.env' | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- assets:/app/app/assets/builds | ||
js: | ||
image: rdv-insertion-web | ||
command: ["yarn", "build", "--watch"] | ||
entrypoint: '' # ignore the Rails commands in entrypoint.sh | ||
volumes: | ||
- assets:/app/app/assets/builds | ||
db: | ||
image: postgres:15 | ||
environment: | ||
POSTGRES_PASSWORD: dummy | ||
PGPORT: 5433 | ||
volumes: | ||
- "./tmp/db:/var/lib/postgresql/data" | ||
ports: | ||
- "5433:5433" | ||
volumes: | ||
assets: |
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
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,10 @@ | ||
#!/bin/sh -l | ||
set -ex | ||
|
||
if [ -f /app/tmp/pids/server.pid ]; then | ||
rm /app/tmp/pids/server.pid | ||
fi | ||
|
||
bin/rails db:prepare | ||
|
||
exec "$@" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seul obstacle pour le moment : AgentConnect qui essaie d'effectuer une connexion à un serveur externe même dans un environnement local
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je suis d'accord on ne devrait pas avoir ce comportement en dev (ça ne devrait pas de poser de problème @Michaelvilleneuve ?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effectivement on peut conditionner ça, de toute façon AgentConnect ne fonctionnera pas en dév
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pour info je crois que Romain a de toute façon rajouté cette condition dans sa PR donc ça finira pas être mergé avec ou sans cette PR