Skip to content
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

Move Docker files into .devcontainer #94

Merged
merged 3 commits into from
May 27, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
12 changes: 8 additions & 4 deletions Dockerfile.dev → .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,18 @@ FROM eligibility_server:latest

USER root

# install tooling: curl, git, jq, ssh
# install python tooling: pip, flake8, pre-commit
# install container tooling
RUN apt-get update \
&& apt-get install -qq --no-install-recommends curl git jq ssh build-essential \
&& python -m pip install --upgrade pip

RUN pip install --no-cache-dir flake8 pre-commit coverage pytest
# install python tooling
RUN pip install --no-cache-dir flake8 pre-commit

# install docs tooling:
# install docs tooling
COPY docs/requirements.txt docs/requirements.txt
RUN pip install --no-cache-dir -r docs/requirements.txt

# install test tooling
COPY tests/requirements.txt tests/requirements.txt
RUN pip install -r tests/requirements.txt
12 changes: 6 additions & 6 deletions docker-compose.yml → .devcontainer/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,30 @@ version: "3.8"

services:
server:
build: .
build: ..
machikoyasuda marked this conversation as resolved.
Show resolved Hide resolved
env_file: .env
image: eligibility_server:latest
ports:
- "5000"
volumes:
- ./:/home/calitp/app/
- ../:/home/calitp/app/
dev:
build:
context: .
dockerfile: Dockerfile.dev
context: ..
dockerfile: .devcontainer/Dockerfile
machikoyasuda marked this conversation as resolved.
Show resolved Hide resolved
command: sleep infinity
entrypoint: []
env_file: .env
image: eligibility_server:dev
ports:
- "5000"
volumes:
- ./:/home/calitp/app/
- ../:/home/calitp/app/
docs:
image: eligibility_server:dev
entrypoint: mkdocs
command: serve --dev-addr "0.0.0.0:8000"
ports:
- "8000"
volumes:
- ./:/home/calitp/app:cached
- ../:/home/calitp/app:cached
6 changes: 3 additions & 3 deletions .devcontainer.json → .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// For format details, see https://aka.ms/vscode-remote/devcontainer.json
{
"name": "cal-itp/eligibility-server",
"dockerComposeFile": ["./docker-compose.yml"],
"dockerComposeFile": ["compose.yml"],
"service": "dev",
"runServices": ["dev", "docs"],
"workspaceFolder": "/home/calitp/app",
"postAttachCommand": ["/bin/bash", "bin/pre-commit.sh"],
"postAttachCommand": ["/bin/bash", ".devcontainer/pre-commit.sh"],

// Set *default* container specific settings.json values on container create.
"settings": {
Expand All @@ -21,6 +21,6 @@
"extensions": [
"batisteo.vscode-django",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.vscode-pylance"
]
}
File renamed without changes.
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Running the application locally is possible with [Docker and Docker Compose](htt
### Build the Docker container for local development

```bash
cd .devcontainer
machikoyasuda marked this conversation as resolved.
Show resolved Hide resolved
docker compose build server
```

Expand Down
2 changes: 2 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ cd eligibility-server
Use the sample as the template.

```bash
cd .devcontainer
cp .env.sample .env
```

Expand All @@ -29,6 +30,7 @@ The .env file specifies two values:
### Build image using Docker Compose

```bash
cd .devcontainer
docker compose build --no-cache server
```

Expand Down