Skip to content

Commit bb94420

Browse files
committed
Added docker-compose
1 parent 80f1e18 commit bb94420

File tree

4 files changed

+33
-28
lines changed

4 files changed

+33
-28
lines changed

.devcontainer/Dockerfile

+2-14
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
11
# Use the specified image as the base
22
FROM mcr.microsoft.com/devcontainers/universal:2-linux
33

4-
# Set the working directory
5-
WORKDIR /app
6-
74
# Update the package lists
8-
RUN apt-get update
5+
RUN apt-get update
96

107
# Install poetry using pipx
118
RUN pipx install poetry
129

13-
# Copy the current directory contents into the container at /app
14-
COPY ../ /app
15-
16-
# Set environment variables
17-
ENV MY_NAME="John Doe"
18-
1910
# Expose port 3000
2011
EXPOSE 3000
2112

22-
# Define the command to run your app using CMD which keeps the container running.
23-
CMD ["poetry", "run", "dev"]
24-
2513
# Set the user to appuser
2614
USER appuser
2715

2816
# Healthcheck
29-
HEALTHCHECK CMD curl --fail http://localhost:3000 || exit 1
17+
# HEALTHCHECK CMD curl --fail http://localhost:3000 || exit 1

.devcontainer/devcontainer.json

+21-10
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,33 @@
33
{
44
"name": "Python server",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"build": {
7-
"dockerfile": "Dockerfile"
8-
// Update 'VARIANT' to pick a non-default Dockerfile variant.
9-
// "args": { "VARIANT": "buster" }
10-
},
6+
// "build": {
7+
// "dockerfile": "Dockerfile"
8+
// // Update 'VARIANT' to pick a non-default Dockerfile variant.
9+
// // "args": { "VARIANT": "buster" }
10+
// },
1111

1212
// Or use docker-compose file.
13-
// "dockerComposeFile": ["docker-compose.yml"],
14-
// "service": "devcontainer",
15-
// "workspaceFolder": "/app",
13+
"dockerComposeFile": "docker-compose.yml",
14+
"service": "app",
15+
"workspaceFolder": "/workspace",
1616

1717
// Features to add to the dev container. More info: https://containers.dev/features.
18-
// "features": {},
18+
"features": {
19+
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
20+
},
1921

2022
// Use 'forwardPorts' to make a list of ports inside the container available locally.
21-
"forwardPorts": [3000],
23+
// "forwardPorts": [3000],
24+
25+
// Use 'portsAttributes' to set default properties for specific forwarded ports.
26+
// More info: https://containers.dev/implementors/json_reference/#port-attributes
27+
// "portsAttributes": {
28+
// "3000": {
29+
// "label": "Hello Remote World",
30+
// "onAutoForward": "notify"
31+
// }
32+
// },
2233

2334
// Use 'postCreateCommand' to run commands after the container is created.
2435
"postCreateCommand": "poetry install"

.devcontainer/docker-compose.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
version: '3.8'
22
services:
3-
devcontainer:
4-
build:
3+
app:
4+
build:
55
context: .
66
dockerfile: Dockerfile
7-
7+
volumes:
8+
- ..:/workspace
89
ports:
9-
- "3080:3080"
10+
- 3000:3000
11+
network_mode: "host"

startDocs.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
cd docs
4+
npm run start

0 commit comments

Comments
 (0)