Skip to content

Commit 9711e7e

Browse files
committed
🩹 fix-simple(Dockerfile): fix a minor issue with Docker images
1 parent 89ba1db commit 9711e7e

3 files changed

Lines changed: 13 additions & 1 deletion

template/{% if dockerfile %}.dockerignore{% endif %} renamed to template/{% if dockerfile %}.dockerignore{% endif %}.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@
33
.dmypy.json
44
dmypy.json
55
.ruff_cache/
6+
**/__pycache__/
7+
dist
8+
{%- if tox %}
9+
.tox
10+
{%- endif %}

‎template/{% if dockerfile %}Dockerfile{% endif %}.jinja‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,13 @@ USER {{ project_name }}
5555
{%- endif %}
5656

5757
# CMD ["uvicorn", "{{ project_name }}:app", "--host", "0.0.0.0", "--port", "8000"]
58+
# CMD ["sleep", "1000"]
5859

5960
# ---------- development image ----------
6061
FROM python:{{ python_version }}-slim-bookworm AS dev
6162

6263
{% if not privileged_container -%}
63-
RUN groupadd -g {{ gid }} {{ project_name }} && useradd -u {{ uid }} -g {{ gid }} -r {{ project_name }}
64+
RUN groupadd -g {{ gid }} {{ project_name }} && useradd -m -u {{ uid }} -g {{ gid }} -r {{ project_name }}
6465

6566
RUN mkdir -p /workspaces/{{ project_name }} && chown -R {{ project_name }}:{{ project_name }} /workspaces
6667
{%- endif %}

‎template/{% if dockerfile %}compose.yaml{% endif %}.jinja‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ services:
1818
count: all
1919
capabilities: [gpu]
2020
{%- endif %}
21+
profiles:
22+
- prod
2123
restart: unless-stopped
2224

2325
{{ project_name }}-dev:
@@ -30,6 +32,10 @@ services:
3032
- ENVIRONMENT=dev
3133
ports:
3234
- "8001:8000"
35+
- "8080:8080"
36+
stdin_open: true
37+
tty: true
38+
command: [ "sh" ]
3339
{%- if gpus %}
3440
deploy:
3541
resources:

0 commit comments

Comments
 (0)