29 lines
653 B
Docker
29 lines
653 B
Docker
FROM denoland/deno:alpine
|
|
|
|
RUN apk add --no-cache wget
|
|
|
|
# The port the application will listen on
|
|
ARG PORT=8090
|
|
ENV PORT=${PORT}
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy the frontend files
|
|
# Since the Dockerfile is in the root and files are in ./, we copy from there
|
|
COPY . .
|
|
|
|
# Ensure the deno user owns the directory so it can write public/config.js
|
|
RUN chown -R deno:deno /app
|
|
|
|
USER deno
|
|
|
|
# Cache dependencies
|
|
RUN deno cache main.ts
|
|
|
|
# Expose the port
|
|
EXPOSE ${PORT}
|
|
|
|
# Run the application
|
|
# We include --allow-write because main.ts writes public/config.js on startup
|
|
CMD ["run", "--allow-net", "--allow-read", "--allow-write", "--allow-env", "--allow-run", "main.ts"]
|