Skip to content

Commit a5fd245

Browse files
committed
Fix docker
1 parent b49e9df commit a5fd245

File tree

2 files changed

+26
-20
lines changed

2 files changed

+26
-20
lines changed

services/app/.containerignore renamed to services/app/.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
# Container
3737
**/Containerfile
38-
**/.containerignore
38+
**/.dockerignore
3939

4040
# Documentation & CI
4141
**/README.md

services/app/Containerfile.dev

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,45 @@
11
FROM elixir:1.19.1-otp-28-alpine
22

3-
# Install Elixir dependencies as root
3+
# Install Elixir tooling
44
RUN mix local.hex --force \
55
&& mix local.rebar --force \
66
&& mix archive.install hex phx_new --force
77

8-
# Install system dependencies
8+
# Install system dependencies + Node.js + npm + podman
99
RUN apk add --no-cache \
1010
inotify-tools \
1111
curl \
1212
vim \
1313
chromium \
1414
postgresql-client \
1515
build-base \
16-
git
16+
git \
17+
nodejs \
18+
npm \
19+
podman
1720

18-
# Install Node.js and pnpm
19-
RUN apk add --no-cache nodejs npm \
20-
&& npm install --global pnpm
21+
# Install pnpm globally
22+
RUN npm install --global pnpm
2123

22-
# Install Podman for local development
23-
RUN apk add --no-cache podman
24+
# Base workdir
25+
WORKDIR /app
2426

25-
# Add non-root user
26-
RUN adduser -D developer
27+
ARG GIT_HASH
28+
ENV APP_VERSION="$GIT_HASH" \
29+
NODE_OPTIONS="--max-old-space-size=4096" \
30+
PNPM_SKIP_BUILD_SCRIPT_CHECK=1
2731

28-
# Copy Hex and other Mix archives from root to developer
29-
RUN cp -R /root/.mix /home/developer/ && chown -R developer:developer /home/developer/.mix
32+
# Copy repo
33+
COPY . .
3034

31-
# Switch to non-root user
32-
USER developer
35+
# Go to Codebattle app where package.json is
36+
WORKDIR /app/apps/codebattle
3337

34-
# Set working directory
35-
WORKDIR /app
38+
# Install JS dependencies for Codebattle
39+
RUN pnpm install --force && pnpm add regenerator-runtime
3640

37-
ARG GIT_HASH
38-
ENV APP_VERSION=$GIT_HASH
39-
ENV NODE_OPTIONS="--max-old-space-size=4096"
41+
# Build Codebattle assets (change to your real script if needed)
42+
RUN pnpm run build
43+
44+
# Return to umbrella root for further Elixir steps (mix deps.get, etc., if you add them later)
45+
WORKDIR /app

0 commit comments

Comments
 (0)